from django import forms
from django.core.exceptions import ValidationError
from .models import Student


# class StudentForm(forms.Form):
#     name = forms.CharField(min_length=2, label="姓名",
#                            error_messages={"min_length": "长度不符合要求,最少2", "required": "该字段不能为空!"})
#     age = forms.IntegerField(label="年龄")

class TeacherForm(forms.Form):
    name = forms.CharField(max_length=10, min_length=2, required=True, label='老师姓名',
                           error_messages={'minlength': '最小长度不符合要求', 'required': '必填'})
    # name = forms.CharField(max_length=10, min_length=2, required=True, label='老师姓名',error_messages={'required':'用户名不能为空'})
    age = forms.IntegerField(max_value=100, label='年龄')
